package com.max.xihu.patterns.proto;

/**
 * @Author: Max
 * @Date: 2020-09-08 22:49
 * @Description:原型模式：实现一个接口，覆写clone方法即可
 */
public class Prototype implements Cloneable{

    @Override
    protected Object clone(){
        Prototype prototype = null;
        try {
            prototype = (Prototype) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return prototype;
    }
    //覆写父类Object方法
    public Prototype() {
        super();
    }
}
